<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', 'IndexController@index')->name('index');
Route::get('about', 'IndexController@about')->name('about');
Route::get('course', 'IndexController@course')->name('course');
Route::get('soft', 'IndexController@soft')->name('soft');
Route::get('service', 'IndexController@service')->name('service');


//Auth::routes();
// 用户身份验证相关的路由
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Route::get('logout', 'Auth\LoginController@logout')->name('logout');


// 用户注册相关路由
Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController@register');

// 密码重置相关路由
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');

// Email 认证相关路由
Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');




Route::resource('product', 'ProductController');





Route::group(['middleware' => ['auth', 'verified']], function () {



    //购物车记录
//    Route::post('cart', 'CartController@add')->name('cart.add');
//    Route::get('cart', 'CartController@index')->name('cart.index');
//    Route::delete('cart/{sku}', 'CartController@remove')->name('cart.remove');


    // 订单入库
//    Route::post('order', 'OrdersController@store')->name('order.store');
//    Route::get('order/{no}', 'OrdersController@edit')->name('order.edit');
//    Route::put('order/{no}', 'OrdersController@update')->name('order.update');
//    Route::get('order/{no}/pay', 'OrdersController@payment')->name('order.payment');
//    Route::post('order/determine', 'OrdersController@determine')->name('order.determine');



});



